#include "heartbtimer.h"
#include <QTimerEvent>

const int kHBInterval = 3000;
HeartBTimer::HeartBTimer(QObject *parent){
    m_nTimerID = this->startTimer(kHBInterval);
}

HeartBTimer::~HeartBTimer(){
    killTimer(m_nTimerID);
}

void HeartBTimer::timerEvent(QTimerEvent *event){
    if(event->timerId() == m_nTimerID){
        handlerTimeout();
    }
}

void HeartBTimer::handlerTimeout(){
    emit SendUsersState();
}
